import request from "@/utils/request";

// 用户登录
export function login(data) {
  return request({
    url: "/api/oauth/Login",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data,
  });
}

// 扫码登录
export function getUserIdByCode(data) {
  return request({
    url: "/api/oauth/getUserIdByCode",
    method: "get",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data,
  });
}
// 获取当前用户信息
export function getInfo(data) {
  return request({
    url: "/api/oauth/CurrentUser",
    method: "get",
    data,
  });
}

// 退出登录
export function logout() {
  return request({
    url: "/api/oauth/Logout",
    method: "get",
  });
}

// 锁屏解锁登录
export function unlock(data) {
  return request({
    url: "/api/oauth/LockScreen",
    method: "post",
    data,
  });
}

// 获取企业微信跳转地址

export function getQyhConfig(data) {
  return request({
    url: "/api/oauth/getQyhConfig",
    method: "get",
    data,
  });
}
// 获取企业微信跳转地址
export function getSystemAddress(terminal) {
  return request({
    url: `/api/oauth/getSystemAddress/${terminal}`,
    method: "get",
  });
}

// 获取默认配置
export function getConfig(account) {
  return request({
    url: `/api/oauth/getConfig/${account}`,
    method: "get",
  });
}

// 获取机器码新消息
export function getLicenseInfo() {
  return request({
    url: "/api/white/license/getLicenseInfo",
    method: "get",
  });
}
